import Vue from 'vue'

import VueRouter from 'vue-router'

import HomeIndex from '@/views/Home'
// import { name } from 'dayjs/locale/*'
Vue.use(VueRouter)

const routes = [
  // {
  //   path: "/", redirect: "/login"
  // },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index')
  },
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/views/Layout/index'),
    children: [
      {
        path: '/',
        name: 'Home',
        component: HomeIndex
      },
      {
        path: '/question',
        name: 'Question',
        component: () => import('@/views/Question/index')
      },
      {
        path: '/video',
        name: 'Video',
        component: () => import('@/views/Video/index')
      },
      {
        path: '/user',
        name: 'User',
        component: () => import('@/views/User/index')
      }
    ]
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('@/views/Search/index')
  },
  {
    path: '/search/result',
    name: 'Result',
    component: () => import('@/views/Search/result')
  }

]

const router = new VueRouter({
  routes
})

export default router
